home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / manage / snmp / kip / fp / cmdidx.h next >
Encoding:
C/C++ Source or Header  |  1989-01-17  |  10.2 KB  |  346 lines

  1. /*
  2. **    Copyright (C) 1987 Kinetics, Inc.  All Rights Reserved.
  3. **    This program contains proprietary confidential information
  4. **    and trade secrets of Kinetics, Inc.  Reverse engineering
  5. **    of object code is prohibited.  Use of copyright notice
  6. **    is precautionary and does not imply publication.
  7. **
  8. **
  9. **
  10. **    Indices into the jump table for PROM routines.
  11. **    Also, the command numbers for the routines when invoked
  12. **    from Kinetics LAP type command packets.
  13. **    The values of these constants are actually determined by
  14. **    their position in the jump table in .../proms/kfpx.s.
  15. **    See cmdmacro.h for the actual calls through the jump table.
  16. **    After the indices are defined, structure definitions for
  17. **    each call's pointer parameter are also defined..
  18. */
  19.  
  20. #define    X_VERSION     0
  21. #define    X_EXECUTE     1
  22. #define    X_ACK         2
  23. #define    X_REBOOT     3
  24. #define    X_SET68         4
  25. #define    X_SET86         5
  26. #define    X_ATINIT     6
  27. #define    X_ATWRITE     7
  28. #define    X_WAIT         8
  29. #define    X_WHEREIS     9
  30. #define    X_GETMEM    10
  31. #define    X_PROTECT    11
  32. #define    X_COPYMEM    12
  33. #define    X_CLRMEM    13
  34. #define    X_PROMRAM    14
  35. #define    X_RESET        15
  36. #define    X_USER0        16
  37. #define    X_USER1        17
  38. #define    X_USER2        18
  39. #define    X_USER3        19
  40. #define    X_USER4        20
  41. #define    X_USER5        21
  42. #define    X_USER6        22
  43. #define    X_USER7        23
  44. #define    X_BUFINIT    24
  45. #define    X_BUFGET    25
  46. #define    X_BUFFREE    26
  47. #define    X_BUFENQ    27
  48. #define    X_BUFDEQ    28
  49. #define    X_ERR        29
  50. #define    X_IDLE        30
  51. #define    X_KLAP        31
  52. #define    X_WHO        32
  53. #define    X_CA86        33
  54. #define    X_RES86        34
  55. #define    X_CLRINT    35
  56. #define    X_RCSID        36
  57. #define    X_EXPROM    37
  58. #define    X_INIPROM    38
  59. #define    X_RES8530    39
  60. #define    X_DMTSERV    40
  61. #define    X_SREC        41
  62. #define    X_SPL        42
  63. #define    X_LED        43
  64. #define    X_RAND        44
  65. #define    X_CMPMEM    45
  66. #define    X_SENDF        46
  67.  
  68. #define    X_MEMSEG    47
  69. #define    X_MALLOC    48
  70. #define    X_FREE        49
  71. #define    X_NOTIMP    63
  72.  
  73. /* structures for the above commands */
  74.  
  75. /* X_VERSION */
  76. struct fp_version {
  77.     short    fpv_entries;        /* number of valid entries in jump table */
  78.     short    fpv_version;        /* version of the prom code */
  79.     long    fpv_model;        /* "KFPS", "KFPQ", or "KFPM" */
  80. };
  81.  
  82. /* X_EXECUTE */
  83. /* no parameters */
  84.  
  85. /* X_ACK */
  86. /* no parameters */
  87.  
  88. /* X_REBOOT */
  89. /* no parameters */
  90.  
  91. /* X_SET68 */
  92. /* no parameters */
  93.  
  94. /* X_SET86 */
  95. /* this structure is really defined in ie.h, but it should look like this */
  96. #ifdef    NEVER
  97. struct scb {
  98.     unsigned short    sc_status;    /* status */
  99.     unsigned short    sc_cmd;        /* command */
  100.     unsigned short    sc_clist;    /* command list */
  101.     unsigned short    sc_rlist;    /* receive frame list */
  102.     unsigned short    sc_crcerrs;    /* crc errors */
  103.     unsigned short    sc_alnerrs;    /* alignment errors */
  104.     unsigned short    sc_rscerrs;    /* resource errors (lack of rfd/rbd's) */
  105.     unsigned short    sc_ovrnerrs;    /* overrun errors (mem bus not avail) */
  106. };
  107. #endif    NEVER
  108.  
  109. /* X_ATINIT */
  110. /* The parameter is a pointer to a short which is filled in with
  111.    the node number chosen by the AppleTalk initialization sequence */
  112.  
  113. /* X_ATWRITE */
  114. struct fp_atwrite {
  115.     short    fpw_length;    /* number of bytes in the following string */
  116.     unsigned char *fpw_str;    /* string to be output onto the network */
  117. };
  118.  
  119. /* X_WAIT */
  120. /* The parameter is a long integer which indicates
  121.    the number of milliseconds to delay */
  122.  
  123. /* X_WHEREIS */
  124. struct fp_whereis {
  125.     char    *fpw_rom0;    /* first address of 1st ROM */
  126.     char    *fpw_rom1;    /* first address of 2nd ROM */
  127.     char    *fpw_8530;    /* address of Zilog 8530 chip */
  128.     char    *fpw_0port;    /* address of 1st 8-bit port */
  129.     char    *fpw_1port;    /* address of 2nd 8-bit port */
  130.     char    *fpw_ram2;    /* address of 1st RAM location */
  131.     char    *fpw_ramtop;    /* address of last RAM location */
  132. };
  133.  
  134. /* X_GETMEM and X_CLRMEM and X_BUFINIT */
  135. struct fp_mem {
  136.     unsigned short fpm_count;    /* number of bytes */
  137.     char    *fpm_memp;    /* addr of allocated or to be cleared memory */
  138. };
  139.  
  140. /* X_PROTECT */
  141. struct fp_proelem {            /* protection array element */
  142.     unsigned short fpp_count;    /* number of bytes to protect */
  143.     char    *fpp_memp;        /* address of memory to protect */
  144.     unsigned short fpp_chksum;    /* checksum of protected memory */
  145. };
  146.  
  147. struct fp_protect {
  148.     short    fpt_oper;    /* type of protection operation and result */
  149.     short    fpt_count;    /* number of elements in protection array */
  150.     struct fp_proelem *fpt_elem; /* addr 1st element in protection array */
  151. };
  152.  
  153. /* fpt_oper operations */
  154. #define    PR_FAIL        -1    /* result: check of checksums failed */
  155. #define    PR_PASS        0    /* result: check of checksums passed */
  156. #define    PR_PROTECT    1    /* operation: start protect via elem array */
  157. #define    PR_CHECK    2    /* operation: verify protect via elem array */
  158. #define    PR_CANCEL    3    /* operation: cancel protect via elem array */
  159.  
  160. /* X_COPYMEM and X_CMPMEM */
  161. struct fp_copy {
  162.     char    *fpc_from;        /* location to copy/cmp bytes from */
  163.     char    *fpc_to;        /* location to copy/cmp bytes to */
  164.     unsigned short fpc_count;    /* number of bytes to copy/cmp */
  165. };
  166.  
  167. /* X_PROMRAM */
  168. struct fp_bufinfo {
  169.     struct pbuf **fpb_pfree;/* beginning of the free list */
  170.     struct pqueue *fpb_pq;    /* received buffers queue (both networks) */
  171.     struct pqueue *fpb_sendq;/* Ethernet transmit queue */
  172.     short    fpb_bsize;    /* size of a buffer including header */
  173.     short    fpb_pbnfree;    /* pbufs on our free list */
  174.     short    fpb_pbndrops;    /* times failed to find space */
  175.     short    fpb_pbntypes[16];/* type specific pbuf allocations */
  176. };
  177.  
  178. struct fp_state {
  179.     unsigned short    fps_atnet;  /* current net number for AppleTalk side */
  180.     unsigned short    fps_etnet;  /* current net number for Ethernet side */
  181.     unsigned char    fps_valid;  /* following AppleTalk node number valid */
  182.     unsigned char    fps_node;   /* current AppleTalk LAP node number */
  183.     unsigned char    fps_netw;   /* network number (not used) */
  184.     unsigned char    fps_bridge; /* last known bridge num on net if any */
  185.     unsigned char    fps_ether[6]; /* current ethernet address */
  186. #define    SNAMESIZE    21        /* extra char for null at end */
  187.     char    fps_name[SNAMESIZE];/* ascii name of the gateway */
  188.     char    fps_file[SNAMESIZE];/* ascii name of srec file last loaded */
  189.     unsigned char    fps_pforce; /* non-zero forces execution of prom loop */
  190.     unsigned char    fps_reserve;
  191.     unsigned char    fps_unused[4];
  192. #define    ZNAMESIZE    33        /* extra char for null at end */
  193.     char    fps_atzone[ZNAMESIZE]; /* zone name for AppleTalk side */
  194.     char    fps_etzone[ZNAMESIZE]; /* zone name for Ethernet side */
  195.     unsigned char    fps_spare[128];/* old proms didn't have this space */
  196. };
  197.  
  198. /* defines for fps_netw */
  199. #define    DDP_NETW    0x00    /* DDP version of the code is loaded */
  200. #define    UDP_NETW    0xFF    /* UDP version of the code is loaded */
  201.  
  202. struct fp_abstats {
  203.     int    fpa_interrupts;    /* Appletalk interrupts */
  204.     int    fpa_ipackets;    /* packets received */
  205.     int    fpa_opackets;    /* packets transmitted */
  206.     int    fpa_crc;    /* crc errors */
  207.     int    fpa_ovr;    /* receive overrun errors */
  208.     int    fpa_iund;    /* receive underrun errors */
  209.     int    fpa_xx;
  210.     int    fpa_yy;
  211.     int    fpa_bad;    /* bad packets received */
  212.     int    fpa_coll;    /* collisions */
  213.     int    fpa_defer;    /* times deferred to other packets */
  214.     int    fpa_idleto;    /* packets that timed out waiting for the end */
  215.     int    fpa_zz;
  216.     int    fpa_nodata;    /* packets without data (nothing after rts) */
  217.     int    fpa_ound;    /* transmit underrun errors */
  218.     int    fpa_badddp;    /* bad ddp packets */
  219.     int    fpa_spur;    /* spurrious interrupts */
  220. };
  221.  
  222. struct fp_iestats {
  223.     struct scb *fpi_scbptr;    /* status control block */
  224.     int    fpi_ipackets;    /* input packets */
  225.     int    fpi_opackets;    /* output packets */
  226.     int    fpi_ierrors;    /* input errors */
  227.     int    fpi_oerrors;    /* output errors */
  228.     int    fpi_cmdbusy;    /* busy waits */
  229. };
  230.  
  231. /*
  232. **    the max size for the following structure is 64
  233. */
  234. struct fp_promram {
  235.     short    fpr_count;            /* number of valid ptrs that follow */
  236.     struct fp_table    **fpr_jtable;    /* jump table */
  237.     struct fp_bufinfo *fpr_bufs;    /* buffer manager vector */
  238.     struct fp_state *fpr_state;    /* Prompt program's state vector */
  239.     struct fp_abstats *fpr_abstats;    /* AppleTalk statistics vector */
  240.     struct fp_iestats *fpr_iestats;    /* Ethernet statistics vector */
  241.     char    *fpr_1debug;            /* first level debug flag */
  242.     char    *fpr_2debug;            /* second level debug flag */
  243.     char    *fpr_3debug;            /* third level debug flag */
  244.     char    fpr_unused[30];        /* remaining ptrs are not defined yet */
  245. };
  246.  
  247. /* X_RESET */
  248. /* no parameters */
  249.  
  250. /* X_USER0, X_USER1, X_USER2, X_USER3, X_USER4, X_USER5, X_USER6, X_USER7 */
  251. /* parameters (if any) defined by user */
  252.  
  253. /* X_BUFGET */
  254. struct fp_bget {
  255.     struct pbuf *fpg_buf;    /* address of buffer returned */
  256.     short    fpg_type;    /* type of buffer to be "gotten" */
  257. };
  258.  
  259. /* X_BUFFREE */
  260. struct fp_bfree {
  261.     struct pbuf *fpf_buf;    /* address of buffer to be freed */
  262.     struct pbuf *fpf_nxt;    /* the freed buffer's link before it was freed*/
  263. };
  264.  
  265. /* X_BUFENQ and  X_BUFDEQ */
  266. struct fp_bqueue {
  267.     struct pqueue *fpq_q;    /* addr of queue to enqueue to / dequeue from */
  268.     struct pbuf *fpq_buf;    /* addr of buffer to be enqueued or dequeued */
  269. };
  270.  
  271. /* X_ERR */
  272. /* no parameters */
  273.  
  274. /* X_IDLE */
  275. /* no parameters */
  276.  
  277. /* X_KLAP */
  278. /* The parameter is the address of a pbuf structure. See pbuf.h. */
  279.  
  280. /* X_WHO */
  281. /* no parameters */
  282.  
  283. /* X_CA86 */
  284. /* no parameters */
  285.  
  286. /* X_RES86 */
  287. /* no parameters */
  288.  
  289. /* X_CLRINT */
  290. /* no parameters */
  291.  
  292. /* X_RCSID */
  293. /* The parameter is the address of a character array which is filled
  294.    in with the current RCS identification string of this PROM version. */
  295.  
  296. /* X_EXPROM */
  297. /* no parameters */
  298.  
  299. /* X_INIPROM */
  300. /* no parameters */
  301.  
  302. /* X_RES8530 */
  303. /* no parameters */
  304.  
  305. /* X_DMTSERV */
  306. /* no parameters */
  307.  
  308. /* X_SREC */
  309. /* The parameter is the address of a character array which contains
  310.    the S-record to be interpreted and used by the gateway */
  311.  
  312. /* X_SPL */
  313. /* The parameter is the address of a short which becomes the next processor
  314.    priority level. The previous priority level is returned at same location */
  315.  
  316. /* X_LED */
  317. struct fp_led {
  318.     char    fpl_leds;        /* bit field: each bit is an led */
  319.     char    fpl_state;        /* LED_ON, LED_OFF, LED_TOGGLE */
  320. };
  321.  
  322. /* constants for fpl_onoff */
  323. #define    LED_OFF        0
  324. #define    LED_ON        1
  325. #define    LED_TOGGLE    2        /* if on, off. if off, on */
  326.  
  327. /* X_RAND */
  328. /* The parameter is the address of a long integer which has a new random
  329.    number in it when the call returns. */
  330.  
  331. /* X_SENDF */
  332. /* The parameter is the address of a stack location which contains a format
  333.    string address and followed by the variable number of arguments which are
  334.    required by that format string */
  335.  
  336. /* X_MEMSEG, X_MALLOC, X_FREE */
  337. struct fp_malloc {
  338.     union {
  339.         long    fpo_size;     /* bytes, for memseg and malloc */
  340.         unsigned char *fpo_area; /* ptr to area, for free */
  341.     } fpo_parm;
  342. };
  343.  
  344. /* X_NOTIMP */
  345. /* no parameters */
  346.